
 <table class="gridlist table-goods-list gridlist_member " style="border-bottom:none" width="100%" border="0" cellspacing="0"  cellpadding="0">
     <{if !$msg}>
            <tr>
                <th class="first"><{t}>订单编号<{/t}></th>
                <th><{t}>商品<{/t}></th>
				<th><{t}>单价（元）<{/t}></th>
				<th><{t}>数量<{/t}></th>
                <th><{t}>实付款（元）<{/t}></th>
                <th><{t}>订单时间<{/t}></th>

                <th><{t}>订单状态<{/t}></th>
                <th><{t}>操作<{/t}></th>
            </tr>
            <tbody>
                <{foreach from=$orders item=order key=key}>
                <tr
				    <{if $key<3}>
                    <{if ($key+1)%2 == 0}>class="order-list-tr"<{/if}>>
                    <td class="vt no_bk" >
                    
                    <a href="<{link app=b2c ctl="site_member" act="orderdetail" arg0=$order.order_id}>" class="operate-btn"><{t}><{$order.order_id}><{/t}></a>
                    </td>
                    <td class="horizontal-m">
                        <{if $order.goods_items}>
                        <{foreach from=$order.goods_items item=item_goods name=goods_item}>
                        <div class="clearfix" <{if $item_goods.product}><{if count($order.goods_items)>1&&end($order.goods_items)!=$item_goods}>class="bottomboder clearfix"<{/if}>>
                            <div class='product-list-img member-gift-pic goodpic' isrc="<{$item_goods.product.thumbnail_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" 
                            <{if $order.order_type == 'group'}>
                            ghref='<{link app=groupbuy ctl=site_product act=index args=$item_goods.product.args}>'
                            <{elseif $order.order_type == 'spike'}>
                            ghref='<{link app=spike ctl=site_product act=index args=$item_goods.product.args }>'
                            <{elseif $order.order_type == 'score'}>
                            ghref='<{link app=scorebuy ctl=site_product act=index args=$item_goods.product.args }>'
                            <{else}>
                            ghref='<{link app=b2c ctl=site_product act=index arg0=$item_goods.product.goods_id}>' 
                            <{/if}>
                            > <img src='<{$res_url}>/images/loading.gif'/> </div>
                            <div class="goods-main clearfix">
                                <div class="goodinfo" >
                                    <h3><{if $item_goods.product.goods_id==0}>
                                          <{$item_goods.product.name}>
                                        <{else}>
                                          <a target="_blank" class="font-blue" 
                                          <{if $order.order_type == 'group'}>
                                            href='<{link app=groupbuy ctl=site_product act=index args=$item_goods.product.args}>'
                                            <{elseif $order.order_type == 'spike'}>
                                            href='<{link app=spike ctl=site_product act=index args=$item_goods.product.args}>'
                                            <{elseif $order.order_type == 'score'}>
                                            href='<{link app=scorebuy ctl=site_product act=index args=$item_goods.product.args}>'
                                            <{else}>
                                            href='<{link app=b2c ctl=site_product act=index arg0=$item_goods.product.goods_id}>' 
                                            <{/if}>>
                                            <{$item_goods.product.name}> </a>
                                     <{/if}>
                                     </h3>
                                     <{if $item_goods.product.attr}><span class="font-gray"><{$item_goods.product.attr}></span><{/if}>
                                </div>
                            </div>
                        </div>
                        <{/if}>

                        <!-- adjunct -->
                        <{if $item_goods.adjunct_items}>
                        <{foreach from=$item_goods.adjunct_items item=item_adjunct name=adjunct_item}>
                        <div class="<{if $item_goods.product}>topborder <{/if}>clearfix ml20 pr">
                            <span class="gift-f">赠</span>
                            <div class='product-list-img member-gift-pic goodpic' isrc="<{$item_adjunct.thumbnail_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" ghref='<{$item_adjunct.link_url}>' > <img src='<{$res_url}>/images/loading.gif'/> </div>
                            <div class="goods-main clearfix">
                                <div class="goodinfo" >
                                    <h3><a target="_blank" href="<{$item_adjunct.link_url}>"> <{$item_adjunct.name}> </a></h3>
                                    <{if $item_adjunct.attr}><br/>
                                    <span class="font-gray"><{$item_adjunct.attr}></span> <{/if}> </div>
                            </div>
                        </div>
                        <{/foreach}>
                        <{/if}>
                        <{if $item_goods.gift_items}>
                        <{foreach from=$item_goods.gift_items item=item_gift name=gift_item}>
                        <div class="<{if $item_goods.product}>topborder <{/if}>clearfix">

                            <div class='product-list-img member-gift-pic goodpic' isrc="<{$item_gift.thumbnail_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" ghref='<{$item_gift.link_url}>' > <img src='<{$res_url}>/images/loading.gif'/> </div>
                            <div class="goods-main clearfix">
                                <div class="goodinfo">
                                    <h3><a target="_blank" href="<{$item_gift.link_url}>"> <{$item_gift.name}> </a>
                                        <input type="button" name="button" id="button" value="<{t}>赠<{/t}>" class="present-btn" />
                                    </h3>
                                    <{if $item_gift.attr}><br/>
                                    <span><{$item_gift.attr}></span> <{/if}> </div>
                            </div>
                        </div>
                        <{/foreach}>
                        <{/if}>
                        <{/foreach}>
                        <{/if}>
                        <!-- gift -->
                        <{if $order.gift_items}>
                        <{foreach from=$order.gift_items item=item_gift name=gift_item}> <div <{if count($order.gift_items)>1&&end($order.gift_items)!=$item_gift}>class="bottomboder clearfix"<{/if}>>
                            <div class="topborder clearfix">
                                <div class='product-list-img member-gift-pic goodpic' isrc="<{$item_gift.thumbnail_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" ghref='<{$item_gift.link_url}>' > <img src='<{$res_url}>/images/loading.gif'/> </div>
                                <div class="goods-main clearfix">
                                    <div style=" width:55%" class="goodinfo">
                                        <h3><a target="_blank" href="<{$item_gift.link_url}>"> <{$item_gift.name}> </a>
                                            <input type="button" name="button" id="button" value="<{t}>赠<{/t}>" class="present-btn" /></h3>
                                        <{if $item_gift.attr}>
                                        <span><{$item_gift.attr}></span> <{/if}> </div>
                                </div>
                            </div>
                            <{/foreach}>
                            <{/if}>

                            <!-- extends -->
                            <{if $order.extends_items}>
                            <{foreach from=$order.extends_items item=item_extends name=item_extends}>
                            <{$item_extends}>
                            <{/foreach}>
                            <{/if}> </td>
                     <!--单价 -->
					<td class="no_bk">
					 <{if $order.goods_items}>
                        <{foreach from=$order.goods_items item=item_goods name=goods_item}>
                        <div class="clearfix" <{if $item_goods.product}><{if count($order.goods_items)>1&&end($order.goods_items)!=$item_goods}>class="bottomboder clearfix"<{/if}>>
                          
                            <div class="goods-main clearfix">
                                <div class="member-gift-price price-wrap clearfix">
                                    <ul>
                                        <li><{$item_goods.product.price|cur_odr:$order.currency}></li>
										<li><del><{$item_goods.product.mktprice|cur_odr:$order.currency}></del></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <{/if}>

                        <!-- adjunct -->
                        <{if $item_goods.adjunct_items}>
                        <{foreach from=$item_goods.adjunct_items item=item_adjunct name=adjunct_item}>
                        <div class="<{if $item_goods.product}>topborder <{/if}>clearfix ml20 pr">
                            <div class="goods-main clearfix">
                                
                                <div class="member-gift-price price-wrap clearfix">
                                    <ul>
                                        <li class="point"><{$item_adjunct.price|cur_odr:$order.currency}></li>
										<li>
										<del>
										<{$item_adjunct.mktprice|cur_odr:$order.currency}>
										</del>
										</li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <{/foreach}>
                        <{/if}>
                        <{if $item_goods.gift_items}>
                        <{foreach from=$item_goods.gift_items item=item_gift name=gift_item}>
                        <div class="<{if $item_goods.product}>topborder <{/if}>clearfix">
                            <div class="goods-main clearfix">
                              
                                <div class="member-gift-price pirce-wrap clearfix">
                                    <ul>
                                        <li class="point"><{$item_gift.price|cur_odr:$order.currency}></li>
										<li><del><{$item_gift.mktprice|cur_odr:$order.currency}></del></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <{/foreach}>
                        <{/if}>
                        <{/foreach}>
                        <{/if}>
                        <!-- gift -->
                        <{if $order.gift_items}>
                        <{foreach from=$order.gift_items item=item_gift name=gift_item}> <div <{if count($order.gift_items)>1&&end($order.gift_items)!=$item_gift}>class="bottomboder clearfix"<{/if}>>
                            <div class="topborder clearfix">
                                <div class="goods-main clearfix">
                                    
                                    <div class="member-gift-price pirce-wrap clearfix">
                                        <ul>
                                            <li class="point"><{$item_gift.price|cur_odr:$order.currency}></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <{/foreach}>
                            <{/if}>

                            <!-- extends -->
                            <{if $order.extends_items}>
                            <{foreach from=$order.extends_items item=item_extends name=item_extends}>
                            <{$item_extends}>
                            <{/foreach}>
                            <{/if}>
					</td>
					<!--数量 -->
					<td class="no_bk">
					 <{if $order.goods_items}>
                        <{foreach from=$order.goods_items item=item_goods name=goods_item}>
                        <div class="clearfix" <{if $item_goods.product}><{if count($order.goods_items)>1&&end($order.goods_items)!=$item_goods}>class="bottomboder clearfix"<{/if}>>
                          
                            <div class="goods-main clearfix">
                                <div class="member-gift-price price-wrap clearfix">
                                    <ul>
                                        <li><{$item_goods.product.quantity}></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <{/if}>

                        <!-- adjunct -->
                        <{if $item_goods.adjunct_items}>
                        <{foreach from=$item_goods.adjunct_items item=item_adjunct name=adjunct_item}>
                        <div class="<{if $item_goods.product}>topborder <{/if}>clearfix ml20 pr">
                            <div class="goods-main clearfix">
                                
                                <div class="member-gift-price price-wrap clearfix">
                                    <ul>
                                        <li><{$item_adjunct.quantity}></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <{/foreach}>
                        <{/if}>
                        <{if $item_goods.gift_items}>
                        <{foreach from=$item_goods.gift_items item=item_gift name=gift_item}>
                        <div class="<{if $item_goods.product}>topborder <{/if}>clearfix">
                            <div class="goods-main clearfix">
                              
                                <div class="member-gift-price pirce-wrap clearfix">
                                    <ul>
                                        <li><{$item_gift.quantity}></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <{/foreach}>
                        <{/if}>
                        <{/foreach}>
                        <{/if}>
                        <!-- gift -->
                        <{if $order.gift_items}>
                        <{foreach from=$order.gift_items item=item_gift name=gift_item}> <div <{if count($order.gift_items)>1&&end($order.gift_items)!=$item_gift}>class="bottomboder clearfix"<{/if}>>
                            <div class="topborder clearfix">
                                <div class="goods-main clearfix">
                                    
                                    <div class="member-gift-price pirce-wrap clearfix">
                                        <ul>
                                            <li><{$item_gift.quantity}></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <{/foreach}>
                            <{/if}>

                            <!-- extends -->
                            <{if $order.extends_items}>
                            <{foreach from=$order.extends_items item=item_extends name=item_extends}>
                            <{$item_extends}>
                            <{/foreach}>
                            <{/if}>
					</td>
                    <td  class="point textcenter no_bk"><{$order.cur_amount|cur_odr:$order.currency:false:true}></td>
                    <td ><{$order.createtime|cdate:FDATE_STIME}></td>
                    <td class="textcenter">
                    <div style="width:100px;display:block;margin:0 auto;">
                        <{$order.status_html}>
                        <{$order.comment}>
                    </div></td>
                    <td>
					<{if $order.status == 'active' && ($order.pay_status=='0' || $order.pay_status=='3')}>
					 <{if $order.payinfo.pay_app_id != '-1'}>
					 <a href="<{link app=b2c ctl="site_member" act="orderPayments" arg0=$order.order_id}>" class="paymoney_btn operate-btn" >
					 <{t}>立即支付<{/t}>
					 </a>
					 <{/if}>
					 <{/if}>
                    <a href="<{link app=b2c ctl="site_member" act="orderdetail" arg0=$order.order_id}>" class="font-blue operate-btn"><{t}>查看订单<{/t}></a>
					<!--订单的取消-->
					<{$order.html}></td>
				 <{/if}>
                </tr>
                <{/foreach}>

            </tbody>
<{else}><tr><td><{$msg}></td></tr><{/if}>
        </table>
<script>
window.addEvent('domready',function(){

  var cart_product_img_viewer=new Element('div',{styles:{'position':'absolute','zIndex':500,'opacity':0,'border':'1px #666 solid'}}).inject(document.body);

  var cpiv_show=function(img,event){

      if(!img)return;
      cart_product_img_viewer.empty().adopt($(img).clone().removeProperties('width','height').setStyle('border','1px #fff solid')).fade(1);

      var size = window.getSize(), scroll = window.getScroll();
        var tip = {x: cart_product_img_viewer.offsetWidth, y: cart_product_img_viewer.offsetHeight};
        var props = {x: 'left', y: 'top'};
        for (var z in props){
            var pos = event.page[z] + 10;
            if ((pos + tip[z] - scroll[z]) > size[z]) pos = event.page[z] - 10 - tip[z];
            cart_product_img_viewer.setStyle(props[z], pos);
        }

  };

   $$('.gridlist .product-list-img').each(function(i){

       new Asset.image(i.get('isrc'),{onload:function(img){
       if(!img)return;
           var _img=img.zoomImg(70,70);
             if(!_img)return;
           _img.setStyle('cursor','pointer').addEvents({
              'mouseenter':function(e){
                 cpiv_show(_img,e);
              },
              'mouseleave':function(e){
                cart_product_img_viewer.fade(0);
              }
           });
           i.empty().adopt(new Element('a',{href:i.get('ghref'),target:'_blank',styles:{border:0}}).adopt(_img));
       },onerror:function(){
            i.empty();

       }});

   });

});

function cancel(order_id){
     Ex_Dialog.confirm('<{t}>确定要取消该订单吗？<{/t}>', function(e){
		if(!e) return;
		new Request.JSON({
			url:"<{link app=b2c ctl='site_member' act='docancel'}>",
			data:'order_id='+order_id,
			method:'POST',
			onSuccess:function(rs){
			
			  Ex_Dialog.alert(rs);
			
			  window.location.reload();
			}
		  }).send();
	});

}
function remind(order_id){
     Ex_Dialog.confirm('<{t}>卖家将会收到发货提醒，确定发送提醒吗？<{/t}>', function(e){
		if(!e) return;
		new Request.JSON({
			url:"<{link app=b2c ctl='site_member' act='remind'}>",
			data:'order_id='+order_id,
			method:'POST',
			onSuccess:function(rs){
			
			  Ex_Dialog.alert(rs);
			
			  window.location.reload();
			}
		  }).send();
	});

}
</script>